function table_screening() {
    var minPrice = $("#price_min").val() == undefined ? "" : $("#price_min").val();
    var maxPrice = $("#price_max").val() == undefined ? "" : $("#price_max").val();
    var mintime = $("#date_min").val() == undefined ? "" : $("#date_min").val();
    var maxtime = $("#date_max").val() == undefined ? "" : $("#date_max").val();
    var catalog = $("#ArticleCatalog").val() == undefined ? "" : $("#ArticleCatalog").val();
    var user_id = $("#Article_Username").val() == undefined ? "" : $("#Article_Username").val();
    var title = $("#order_id").val() == undefined ? "" : $("#order_id").val();
    var where = {
        maxPrice: maxPrice,
        minPrice: minPrice,
        minTime: mintime,
        maxTime: maxtime,
        catalog: catalog,
        user_id: user_id,
        search: title
    };
    RenderTable("#ArticleList", '', '/CenterInc/view_json/admin/Article_priview_json.aspx', true, [[
        {field: 'caozuo', title: '操作', fixed: 'left', type: 'checkbox'}
        , {field: 'Id', title: 'ID', sort: true}
        , {field: 'User_id', title: '用户ID'}
        , {field: 'Title', title: '标题', sort: true}
        , {field: 'Img', title: '封面'}
        , {field: 'Catalog', title: '分类'}
        , {field: 'Describe', title: '描述'}
        , {field: 'Price', title: '价格'}
        , {field: 'Time', title: '时间', sort: true}

        , {field: 'toolbar', title: '操作', align: 'center', toolbar: '#table_bar'}
    ]], '20', '', 'post', where);


}

function tabel_event() {
    table.on('tool(ArticleList)', function(obj){ //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
        var table_Row = obj.data //获得当前行数据
            ,layEvent = obj.event; //获得 lay-event 对应的值
        console.log(table_Row);
        if(layEvent === 'del'){
            layer.confirm('请确认是否删除？', {
                btn: ['是','否'] //按钮
            }, function(){
                $.post("/CenterInc/view_inc/Article_inc.aspx?mode=1",{article_id:table_Row.Id},function (data) {
                    if(data["error"]!=undefined){
                        layer.msg(data["error"], {icon: 5});
                        return;
                    }
                    layer.msg(data["msg"], {icon: 1});
                    setTimeout("window.location.reload()",2000);
                });

            });
            console.log(table_Row);
        } else if(layEvent === 'edit'){
            window.parent.open_page(table_Row.Title+"-编辑",'/article/ArticleWrite.aspx?edit=1&article_id='+table_Row.Id,'edit_article_'+table_Row.Id);
            return;
        }
    });
}

function getSelectedRowMsgDel() {
    var checkStatus = table.checkStatus('ArticleList'); //idTest 即为基础参数 id 对应的值
    console.log(checkStatus.data); //获取选中行的数据
    var count=checkStatus.data.length;
    if(count==0){
        Popup.msg("您暂未选择任何数据",{icon: 5});
        return;
    }
    Popup.confirm("请确认是否需要删除选中的数据？",
        {btn: ['是','否']}
        ,function () {
            var i=0;
            for(;i<count;i++){
                $.post("/CenterInc/view_inc/Article_inc.aspx?mode=1",{article_id:checkStatus.data[i].Id},function (data) {
                    if(data["error"]!=undefined){
                        Popup.msg("文章id："+checkStatus.data[i].Id+"删除失败："+data["error"],{icon: 5});
                        return;
                    }
                });
            }
            Popup.msg("选中数据删除成功，可在回收站进行恢复",{icon: 1});
            setTimeout("window.location.reload()",2000);
            return;
        });
}
function getSelectedRowMsgMove() {
    var checkStatus = table.checkStatus('ArticleList'); //idTest 即为基础参数 id 对应的值
    console.log(checkStatus.data); //获取选
    var catalog=$("#MoveCatalog").val();
    console.log(catalog);
    var count=checkStatus.data.length;
    if(count==0){
        Popup.msg("您暂未选择任何数据",{icon: 5});
        return;
    }
    if(catalog.length==0){
        Popup.msg("请选择目录",{icon: 5});
        return;
    }
    Popup.confirm("请确认是否需要移动选中的数据至指定目录？",
        {btn: ['是','否']}
        ,function () {
            var i=0;
            for(;i<count;i++){
                $.post("/CenterInc/view_inc/Article_inc.aspx?mode=5",{article_id:checkStatus.data[i].Id,catalog:catalog},function (data) {
                    if(data["error"]!=undefined){
                        Popup.msg("文章id："+checkStatus.data[i].Id+"移动失败",{icon: 5});

                    }
                });
            }
            Popup.msg("选中数据移动成功",{icon: 1});
            setTimeout("window.location.reload()",2000);
            return;
        });
}